<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3_元素消失方式</title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }
        .d1{background-color: lightgreen}
        .d1:hover{transform: scale(0)}/*缩小到看不见,不会释放布局空间*/
        .d2{background-color: lightpink}
        .d2:hover{display: none}/*修改显示模式为消失,释放布局空间*/
        .d3{background-color: lightcoral }
        .d3:hover{opacity: 0}/*修改透明度为消失,不会释放布局空间*/
        .d4{background-color: lightsalmon}
        .d4:hover{background-color: rgba(0,0,0,0)}/*只能让背景色消失,并不会让文字消失*/
    </style>
</head>
<body>
<div class="d1">11</div>
<div class="d2">22</div>
<div class="d3">33</div>
<div class="d4">44</div>
</body>
</html>